<script setup lang="ts">
import { useRoute } from 'vue-router'
import BatchCreatedDetail from './BatchCreatedDetail.vue'
import BatchEditedDetail from './BatchEditedDetail.vue'
import BatchIdentifiedDetail from './BatchIdentifiedDetail.vue'
import BatchRegisteredDetail from './BatchRegisteredDetail.vue'
import BatchNoIdentifyDetail from './BatchNoIdentifyDetail.vue'

const route = useRoute()

/**
 * 新建后
 * 编辑后
 * 鉴定申请后
 * 鉴定登记后
 * 无需鉴定
 *
 * 是否编辑后的条件要放到最后
 */
const isCreated = route.query.isCreated === 'true'
const isEdited = route.query.isEdited === 'true'
const isIdentified = route.query.isIdentified === 'true'
const isRegistered = route.query.isRegistered === 'true'
const isNoIdentify = route.query.isNoIdentify === 'true'
</script>

<template>
  <DetailFormProvider>
    <BatchRegisteredDetail v-if="isRegistered && !isNoIdentify" />
    <BatchIdentifiedDetail v-else-if="isIdentified && !isNoIdentify" />
    <BatchNoIdentifyDetail v-else-if="isNoIdentify" />
    <BatchCreatedDetail v-else-if="isCreated" />
    <BatchEditedDetail v-else-if="isEdited" />
  </DetailFormProvider>
</template>
